import BasicInfo from './basicInfo';
import BasicAttri from './basicAttri';
import FightAttri from './fightAttri';
import MapInfo from './mapInfo';
import MazeInfo from './mazeInfo';
import packageHandle from 'server/handle/packageHandle';
import HomeInfo from './homeInfo';
import utils from 'server/core/utils';
import partnerHandle from 'server/handle/partnerHandle';
import PartnerModel from './partnerModel';

import {
    totalConfig,
    propName
} from 'server/config/templateConfig';
let playerConfigId = totalConfig.base.playerId;
let playerConfig = totalConfig.player[playerConfigId];
let basicAttriConfig = playerConfig.basicAttri;
let skillConfig = totalConfig.skill;
let mazeConfig = totalConfig.maze;



export default class PlayerModel {
    constructor(opts) {
        opts = opts || {};
        this.id = opts.id || 0;
        this.name = '玩家' || 1;
        this.basicInfo = BasicInfo.create(opts.basicInfo); //基础信息
        this.partnerTeams = opts.partnerTeams || []; //队伍
        this.partnerTeams = this.partnerTeams.map(item => {
            item.status = 1;
            return partnerHandle.initAttri(item);
        });
        this.battleTeams = opts.battleTeams || [];
        this.battleTeams = this.battleTeams.map(item => {
            item.status = 2;
            return partnerHandle.initAttri(item);
        });
        this.mazeInfos = MazeInfo.create(opts.mazeInfos);
        // this.homeInfo = HomeInfo.create(opts.homeInfo);
        this.bag = packageHandle.initPackag(opts.bag);
        this.toolBag = packageHandle.initPackag(opts.toolBag);
    }

}